<?php
namespace jy_pingdd;
defined('BY_JYA') or exit('error');
/*
	任务
*/
class task extends \plugin{
	/*
		团UP
	*/
	public function teamup(){
		$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>0,'plugin_name'=>'jy_pingdd');
		$team = pdo_getall('jy_weishop_groups_team',$params,array('id','goodsid','createtime'));
		if($team){
			foreach($team as $a){
				$grouptime=pdo_getcolumn('jy_weishop_goods',array('uniacid'=>$_SESSION['uniacid'],'id'=>$a['goodsid']),'grouptime');
				$grouptime=intval($grouptime)?:48;
				$grouptime=3600*$grouptime;
				if(time()>$grouptime+$a['createtime']){
					$this->model('model')->order_cancel($a['id']);
				}				
			}
		}
	}
}